<script lang="ts" setup>
import { ref, useCssModule } from 'vue';
const props = defineProps<{ value?: String }>();
const emits = defineEmits(['change']);
const color = ref('red');
</script>

<template>
  <div class="test-components-container">
    <div class="test-container" :class="$style.red">
      <button
        @click="
          emits('change', props.value);
          color = 'blue';
        "
      >
        测试通信
      </button>
    </div>
  </div>
</template>

<style lang="scss" module>
.red {
  background: v-bind(color);
  .reds {
    color: red;
  }
}
</style>
